package graduate.cslg.com.universityshopping.dormitory;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;

import graduate.cslg.com.universityshopping.R;

public class DormitoryActivity extends AppCompatActivity implements View.OnClickListener {

    LinearLayout mLayout1, mLayout2, mLayout3, mLayout4, mLayout5, mLayout6, mLayout7, mLayout8;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_dormitory);
        initViews();
    }

    private void initViews() {
        mLayout1 = findViewById(R.id.ll_1);
        mLayout1.setOnClickListener(this);
        mLayout2 = findViewById(R.id.ll_2);
        mLayout2.setOnClickListener(this);
        mLayout3 = findViewById(R.id.ll_3);
        mLayout3.setOnClickListener(this);
        mLayout4 = findViewById(R.id.ll_4);
        mLayout4.setOnClickListener(this);
        mLayout5 = findViewById(R.id.ll_5);
        mLayout5.setOnClickListener(this);
        mLayout6 = findViewById(R.id.ll_6);
        mLayout6.setOnClickListener(this);
        mLayout7 = findViewById(R.id.ll_7);
        mLayout7.setOnClickListener(this);
        mLayout8 = findViewById(R.id.ll_8);
        mLayout8.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.ll_1:
                Intent intent1 = new Intent(this, MyDorActivity.class);
                startActivity(intent1);
                break;
            case R.id.ll_2:
                Intent intent2 = new Intent(this, CheckInActivity.class);
                startActivity(intent2);
                break;
            case R.id.ll_3:
                Intent intent3 = new Intent(this, ChangePlaceActivity.class);
                startActivity(intent3);
                break;
            case R.id.ll_4:
                Intent intent4 = new Intent(this, CheckOutActivity.class);
                startActivity(intent4);
                break;
            case R.id.ll_5:
                Intent intent5 = new Intent(this, ScoreActivity.class);
                startActivity(intent5);
                break;
            case R.id.ll_6:
                Intent intent6 = new Intent(this, NewBedActivity.class);
                startActivity(intent6);
                break;
            case R.id.ll_7:
                Intent intent7 = new Intent(this, OnlineRepairActivity.class);
                startActivity(intent7);
                break;
            case R.id.ll_8:
                Intent intent8 = new Intent(this, DetentionActivity.class);
                startActivity(intent8);
                break;
        }
    }
}
